package com.example.myshop.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
@Data
public class PayVO implements Serializable {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long uid;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pid;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long oid;
    private Date payTime;
    private Integer status;
    private Integer num;
    private Integer priority;
    private String title;
    private Integer pStatus;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long businessId;
    private Integer price;

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "PayVO{" +
                "uid=" + uid +
                ", pid=" + pid +
                ", oid=" + oid +
                ", payTime=" + payTime +
                ", status=" + status +
                ", num=" + num +
                ", priority=" + priority +
                ", title='" + title + '\'' +
                ", pStatus=" + pStatus +
                ", businessId=" + businessId +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PayVO)) return false;
        PayVO payVO = (PayVO) o;
        return Objects.equals(getUid(), payVO.getUid()) &&
                Objects.equals(getPid(), payVO.getPid()) &&
                Objects.equals(getOid(), payVO.getOid()) &&
                Objects.equals(getPayTime(), payVO.getPayTime()) &&
                Objects.equals(getStatus(), payVO.getStatus()) &&
                Objects.equals(getNum(), payVO.getNum()) &&
                Objects.equals(getPriority(), payVO.getPriority()) &&
                Objects.equals(getTitle(), payVO.getTitle()) &&
                Objects.equals(getStatus(), payVO.getStatus()) &&
                Objects.equals(getBusinessId(), payVO.getBusinessId()) &&
                Objects.equals(price, payVO.price);
    }

    @Override
    public int hashCode() {
        return Objects.hash(getUid(), getPid(), getOid(), getPayTime(), getStatus(), getNum(), getPriority(), getTitle(), getStatus(), getBusinessId(), price);
    }



}
